﻿using AvaloniaMVVM.Services;
using ReactiveUI;
using System.Windows.Input;

namespace AvaloniaMVVM.ViewModels
{
    public partial class MainWindowViewModel : ViewModelBase
    {
        string message = "Welcome to Avalonia!";
        private readonly IPoetryStorage poetryStorage;

        public string Message { get => message; set => this.RaiseAndSetIfChanged(ref message, value); }

        public ICommand SayHelloCommand { get; set; }

        public MainWindowViewModel(IPoetryStorage poetryStorage)
        {
            this.SayHelloCommand = ReactiveCommand.Create(SayHello);
            this.poetryStorage = poetryStorage;
        }

        private void SayHello()
        {
            this.Message = "Hello Avalonia";
        }
    }
}
